<template>
    <div class="forum-tem1-wrap">
        <div class="list">
            <ForumComment v-for="(item, index) in list" :item="item" :key="index"></ForumComment>
        </div>
        <div class="pagination">
            <el-pagination background layout="prev, pager, next" :total="total" @current-change="currentPageFun">
            </el-pagination>
        </div>
    </div>
</template>

<script>
import ForumComment from '../components/forum-comment.vue';
import {myCommentList} from '@/api/forum';
export default {
    components: {
        ForumComment
    },
    data() {
        return {
            params:{
                page:1,
                limit:10,
                is_my:1
            },
            total:0,
            list:[]
        };
    },
    mounted() {
        this.getListFun();
    },
    methods: {
        currentPageFun(page) {
            this.params.page = page;
            this.getListFun();
        },
        getListFun(){
            myCommentList(this.params).then(res=>{
                if(res.code == 200){
                    this.list = res.data.list
                    this.total = res.data.count
                }
            })
        },
    }
}
</script>

<style lang="less" scoped>
.forum-tem1-wrap {

    .pagination {
        display: flex;
        justify-content: center;
        padding: 0 0.375rem 1rem;
    }

    .list {
        padding: 0.3rem 0.5rem;

    }
}
</style>